<template>
	<curr-flow-mode-index v-if="!isold" :flowInts="flowInts"></curr-flow-mode-index>
  <old-flow-mode-index v-else :flowInts="flowInts"></old-flow-mode-index>


</template>
<script>

import CurrFlowModeIndex from "@/components/flowable/flowModel/currFlowModeIndex.vue";
import OldFlowModeIndex from "@/components/flowable/flowModel/OldFlowModeIndex.vue";
import FlowApi from "@/api/flowable/FlowApi";

export default {
	name: "dyFlowModel",
	components: {CurrFlowModeIndex, OldFlowModeIndex},
	props: {
		flowInts: {type: Object, default: {}},
		flowDef: {type: Object, default: null},
		//isold: {type: Boolean, default: false},
	},
	data() {
		return {
		isold:false
		}
	},
	created() {
		this.isAlready = true;
		console.log(this.flowInts);
		if(this.flowInts.id){

			FlowApi.listOldFlows({ flowInstId: this.flowInts.id  }).then((resp2) => {
				if(resp2.code=2000){
					if(resp2.data.length>0){

						this.isold=true;
					}
				}
			});

		}
	},

	methods: {
		dblClick: function () {
			this.drawerModel = true;
		},
	}
}
</script>
